package com.zhq.util;

import com.zhq.bean.User;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * @Author:钟豪强
 * @Description:
 * @Date Created in  2020-08-18 0:45
 * @Modified By:
 */
public class UserUtil {
    public static String getUserName(HttpSession session){
        return (String) session.getAttribute("adminUserName");
    }

    // TODO : 还没有编写柜子端,为存储任何的录入人的信息
    public static String getUserPhone(HttpSession session){
        return (String) session.getAttribute("adminUserPhone");
    }

    public static String getLoginSms(HttpSession session, String userPhone){
        return (String) session.getAttribute(userPhone);
    }

    public static void setLoginSms(HttpSession session, String userPhone, String code){
        session.setAttribute(userPhone, code);
    }

    public static void setWxUser(HttpSession session, User user){
        session.setAttribute("wxUser",user);
    }

    public static User getWxUser(HttpSession session){
       return (User) session.getAttribute("wxUser");
    }


}
